package com.example.springcloudconfig.encrypt;

import org.springframework.cloud.context.encrypt.EncryptorFactory;
import org.springframework.security.crypto.encrypt.TextEncryptor;

/**
 * @author scout.du
 * @date 2024/12/30 16:48
 **/
public class Test {

    public static void main(String[] args) {
        TextEncryptor encryptor = new EncryptorFactory().create("JsKiVByGHqeD6aU89");

        //decrypt
        String old_decrypt = encryptor.decrypt("4e7f08aa3a4eaf0f9023a216f450be4d7f6cc00818b3badf1b75b6dee25eedd9f2100108b035d436d48881ad785020f5");
        System.out.println("decrypt = " + old_decrypt);

        //encrypt
//        String encrypt = encryptor.encrypt("Test@1109");
//        System.out.println("encrypt = " + encrypt);
    }
}
